"use strict";
cc._RF.push(module, 'f13edOxXvtIz6+X5niMRHec', 'AudioAutoPlay');
// script/original/Standar/Utils/AudioAutoPlay.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {
    autoPlay: false,
    interval: 5,
    // 以秒为单位的时间间隔
    repeat: -1,
    // 重复次数
    delay: 0,
    // 开始延时
    audio: {
      "default": null,
      type: cc.AudioSource,
      visible: false,
      serializable: false
    }
  },
  onLoad: function onLoad() {
    this.audio = this.node.getComponent(cc.AudioSource);

    if (this.autoPlay) {
      if (this.audio != null) {
        this.schedule(function () {
          this.audio.play();
        }, this.interval, this.repeat, this.delay);
      }
    }
  },
  playAudio: function playAudio() {
    this.audio.play();
  }
});

cc._RF.pop();